

<!DOCTYPE html>
<html lang="zh" data-default-color-scheme=&#34;auto&#34;>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/walker_sue/img/favicon.png">
  <link rel="icon" type="image/png" href="/walker_sue/img/favicon.png">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="">
  <meta name="author" content="lk">
  <meta name="keywords" content="">
  <title>新闻自动化处理（一） - Walker_Sue</title>

  <link  rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.staticfile.org/github-markdown-css/4.0.0/github-markdown.min.css" />
  <link  rel="stylesheet" href="/walker_sue/lib/hint/hint.min.css" />

  
    
    
      
      <link  rel="stylesheet" href="https://cdn.staticfile.org/highlight.js/10.0.0/styles/github-gist.min.css" />
    
  

  


<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">


<link  rel="stylesheet" href="/walker_sue/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script  src="/walker_sue/js/utils.js" ></script>
  <script  src="/walker_sue/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 5.3.0"></head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand"
       href="/walker_sue/">&nbsp;<strong>Walker</strong>&nbsp;</a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/walker_sue/">
                <i class="iconfont icon-home-fill"></i>
                主页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/walker_sue/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/walker_sue/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/walker_sue/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/walker_sue/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item dropdown">
              <a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <i class="iconfont icon-books"></i>
                文档
              </a>
              <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                
                  
                  
                  
                  <a class="dropdown-item" target="_blank" rel="noopener" href="https://hexo.fluid-dev.com/">
                    
                    主题博客
                  </a>
                
                  
                  
                  
                  <a class="dropdown-item" target="_blank" rel="noopener" href="https://hexo.fluid-dev.com/docs/guide/">
                    
                    配置指南
                  </a>
                
                  
                  
                  
                  <a class="dropdown-item" target="_blank" rel="noopener" href="https://hexo.fluid-dev.com/docs/icon/">
                    
                    图标用法
                  </a>
                
              </div>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" data-toggle="modal" data-target="#modalSearch">&nbsp;<i
                class="iconfont icon-search"></i>&nbsp;</a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" href="javascript:">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner intro-2" id="background" parallax=true
         style="background: url('/walker_sue/img/default.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="container page-header text-center fade-in-up">
    <span class="h2" id="subtitle">
    
</span>




<div class="mt-3">
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2021-01-28 16:42" pubdate>
        January 28, 2021 pm
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      1.7k 字
    </span>
  

  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      22
       分钟
    </span>
  

  
  
</div>


</div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid">
  <div class="row">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-md">
      <div class="container nopadding-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto" id="post">
            <!-- SEO header -->
            <h1 style="display: none">新闻自动化处理（一）</h1>
            
            <div class="markdown-body" id="post-body">
              <div align='center' ><font size='10'>机器学习-BI</font></div>

<hr>
<div align='center' ><font size='5'>Week_03</font></div>
<div align='center' ><font size='5'>中文文本处理</font></div>

<hr>
<h2 id="中文文本处理"><a href="#中文文本处理" class="headerlink" title="中文文本处理"></a>中文文本处理</h2><h3 id="1-分词与词性"><a href="#1-分词与词性" class="headerlink" title="1. 分词与词性"></a>1. 分词与词性</h3><blockquote>
<p>分词:</p>
<ul>
<li>NLTK库，对英文文本预处理</li>
</ul>
</blockquote>
<ul>
<li>jieba库，对中文文本预处理</li>
<li>停用词（Stop Words）：需要自动过滤掉某些字或词</li>
<li>语料（Corpus）：一组原始文本的集合，用于无监督地训练文本</li>
</ul>
<blockquote>
<p>词性:</p>
<ul>
<li>词性标注:名词/动词/形容词/助词…</li>
</ul>
</blockquote>
<ul>
<li>命名实体识别: 人名（Nh）、机构名（Ni）、地名（Ns）</li>
<li>可以使用哈工大pyltp包</li>
</ul>
<pre><code class="hljs python"><span class="hljs-comment"># -*- coding: utf-8 -*-</span>
<span class="hljs-keyword">from</span> pyltp  <span class="hljs-keyword">import</span> SentenceSplitter
<span class="hljs-keyword">from</span> pyltp <span class="hljs-keyword">import</span> Segmentor
<span class="hljs-keyword">from</span> pyltp <span class="hljs-keyword">import</span> Postagger
<span class="hljs-keyword">from</span> pyltp <span class="hljs-keyword">import</span> NamedEntityRecognizer

ldir=<span class="hljs-string">&#x27;AgriKG\\ltp\\cws.model&#x27;</span>  <span class="hljs-comment">#分词模型</span>
dicdir=<span class="hljs-string">&#x27;word&#x27;</span>                           <span class="hljs-comment">#外部字典</span>
text = <span class="hljs-string">&quot;贵州财经大学要举办大数据比赛吗？&quot;</span>

<span class="hljs-comment">#中文分词</span>
segmentor = Segmentor()                             <span class="hljs-comment">#初始化实例</span>
segmentor.load_with_lexicon(ldir, <span class="hljs-string">&#x27;word&#x27;</span>)    <span class="hljs-comment">#加载模型</span>
words = segmentor.segment(text)                 <span class="hljs-comment">#分词</span>
print(text)
print(<span class="hljs-string">&#x27; &#x27;</span>.join(words))                                     <span class="hljs-comment">#分词拼接</span>
words = <span class="hljs-built_in">list</span>(words)                                      <span class="hljs-comment">#转换list</span>
print(<span class="hljs-string">u&quot;分词:&quot;</span>, words)
segmentor.release()                                      <span class="hljs-comment">#释放模型</span>

<span class="hljs-comment">#词性标注</span>
pdir=<span class="hljs-string">&#x27;AgriKG\\ltp\\pos.model&#x27;</span>
pos = Postagger()                                        <span class="hljs-comment">#初始化实例</span>
pos.load(pdir)                                              <span class="hljs-comment">#加载模型</span>

postags = pos.postag(words)                        <span class="hljs-comment">#词性标注</span>
postags = <span class="hljs-built_in">list</span>(postags)
print(<span class="hljs-string">u&quot;词性:&quot;</span>, postags)
pos.release()                                               <span class="hljs-comment">#释放模型</span>

data = &#123;<span class="hljs-string">&quot;words&quot;</span>: words, <span class="hljs-string">&quot;tags&quot;</span>: postags&#125;
print(data)
print(<span class="hljs-string">&quot; &quot;</span>)

<span class="hljs-comment">#命名实体识别</span>
nermodel=<span class="hljs-string">&#x27;AgriKG\\ltp\\ner.model&#x27;</span>
reg = NamedEntityRecognizer()                    <span class="hljs-comment">#初始化命名实体实例</span>
reg.load(nermodel)                                       <span class="hljs-comment">#加载模型</span>
netags = reg.recognize(words, postags)         <span class="hljs-comment">#对分词、词性标注得到的数据进行实体标识</span>
netags = <span class="hljs-built_in">list</span>(netags)
print(<span class="hljs-string">u&quot;命名实体识别:&quot;</span>, netags)

<span class="hljs-comment">#实体识别结果</span>
data=&#123;<span class="hljs-string">&quot;reg&quot;</span>: netags,<span class="hljs-string">&quot;words&quot;</span>:words,<span class="hljs-string">&quot;tags&quot;</span>:postags&#125;
print(data)
reg.release()                                                 <span class="hljs-comment">#释放模型</span></code></pre>
<blockquote>
<p>jieba使用:</p>
</blockquote>
<pre><code class="hljs python"><span class="hljs-keyword">import</span> jieba
<span class="hljs-keyword">import</span> jieba.posseg <span class="hljs-keyword">as</span> pseg <span class="hljs-comment">#词性标注</span>
<span class="hljs-keyword">import</span> jieba.analyse <span class="hljs-keyword">as</span> anls <span class="hljs-comment">#关键词提取</span>

<span class="hljs-comment"># 全模式</span>
seg_list = jieba.cut(<span class="hljs-string">&quot;他来到上海交通大学&quot;</span>, cut_all=<span class="hljs-literal">True</span>)
print(<span class="hljs-string">&quot;【全模式】：&quot;</span> + <span class="hljs-string">&quot;/ &quot;</span>.join(seg_list))  

<span class="hljs-comment"># 精确模式</span>
seg_list = jieba.cut(<span class="hljs-string">&quot;他来到上海交通大学&quot;</span>, cut_all=<span class="hljs-literal">False</span>)
print(<span class="hljs-string">&quot;【精确模式】：&quot;</span> + <span class="hljs-string">&quot;/ &quot;</span>.join(seg_list))  

<span class="hljs-built_in">type</span>(seg_list)
<span class="hljs-comment"># generator</span>

<span class="hljs-comment"># 返回列表</span>
seg_list = jieba.lcut(<span class="hljs-string">&quot;他来到上海交通大学&quot;</span>, cut_all=<span class="hljs-literal">True</span>)
print(<span class="hljs-string">&quot;【返回列表】：&#123;0&#125;&quot;</span>.<span class="hljs-built_in">format</span>(seg_list))

<span class="hljs-built_in">type</span>(seg_list)
<span class="hljs-comment"># list</span>

<span class="hljs-comment"># 搜索引擎模式</span>
seg_list = jieba.cut_for_search(<span class="hljs-string">&quot;他毕业于上海交通大学机电系，后来在一机部上海电器科学研究所工作&quot;</span>)  
print(<span class="hljs-string">&quot;【搜索引擎模式】：&quot;</span> + <span class="hljs-string">&quot;/ &quot;</span>.join(seg_list))

<span class="hljs-comment"># 未启用 HMM</span>
seg_list = jieba.cut(<span class="hljs-string">&quot;他来到了网易杭研大厦&quot;</span>, HMM=<span class="hljs-literal">False</span>) <span class="hljs-comment">#默认精确模式和启用 HMM</span>
print(<span class="hljs-string">&quot;【未启用 HMM】：&quot;</span> + <span class="hljs-string">&quot;/ &quot;</span>.join(seg_list))  

<span class="hljs-comment"># 识别新词</span>
seg_list = jieba.cut(<span class="hljs-string">&quot;他来到了网易杭研大厦&quot;</span>) <span class="hljs-comment">#默认精确模式和启用 HMM</span>
print(<span class="hljs-string">&quot;【识别新词】：&quot;</span> + <span class="hljs-string">&quot;/ &quot;</span>.join(seg_list))  

<span class="hljs-comment"># 载入词典</span>
jieba.load_userdict(file_name) 
jieba.add_word(<span class="hljs-string">&#x27;石墨烯&#x27;</span>) <span class="hljs-comment">#增加自定义词语</span>
jieba.add_word(<span class="hljs-string">&#x27;凱特琳&#x27;</span>, freq=<span class="hljs-number">42</span>, tag=<span class="hljs-string">&#x27;nz&#x27;</span>) <span class="hljs-comment">#设置词频和词性 </span>
jieba.del_word(<span class="hljs-string">&#x27;自定义词&#x27;</span>) <span class="hljs-comment">#删除自定义词语 </span>

<span class="hljs-comment"># 关键词提取</span>
<span class="hljs-comment"># jieba中使用TextRank提取关键词</span>
jieba.analyse.textrank(string, topK=<span class="hljs-number">20</span>, withWeight=<span class="hljs-literal">True</span>, allowPOS=())
<span class="hljs-comment"># string：待处理语句</span>
<span class="hljs-comment"># topK：输出topK个词，默认20</span>
<span class="hljs-comment"># withWeight：是否返回权重值，默认false</span>
<span class="hljs-comment"># allowPOS：是否仅返回指定类型，默认为空</span>

<span class="hljs-comment"># jieba中使用TF-IDF提取关键词</span>
jieba.analyse.extract_tags(sentence, topK=<span class="hljs-number">20</span>, withWeight=<span class="hljs-literal">True</span>, allowPOS=())
<span class="hljs-comment"># 效果好于TextRank，考虑了IDF的情况，而TextRank倾向使用频繁词</span>
<span class="hljs-comment"># 效率高于TextRank，TextRank基于图的计算和迭代较慢</span>

<span class="hljs-comment"># 词性标注</span>
words = pseg.cut(<span class="hljs-string">&quot;他改变了中国&quot;</span>)</code></pre>
<hr>

<h3 id="2-TF-IDF-算法"><a href="#2-TF-IDF-算法" class="headerlink" title="2.TF-IDF 算法"></a>2.TF-IDF 算法</h3><p><strong>TF-IDF 算法</strong></p>
<p>可用该算法提取关键字<br>$$词频(TF)=\frac{某个词在文章中出现的次数}{文章的总词数}$$<br>但是当多个词在同一篇文章中出现的次数一样时，它们的重要性可能是不一样的，当不常见的词出现的次数较多时，则该词就很重要了，所以又引入了以下概念：
<br>$$逆文档频率(IDF)=\log\frac{语料库的文档总数}{包含该词的文档数+1}$$</p>
<p>$$TF-IDF=词频(TF)\times 逆文档频率(IDF)$$</p>
<hr>
<p><strong>PageRank 算法</strong></p>
<p>把互联网看作一个有向图，每个网页看作一个节点，而如果网页 A 中有指向网页 B 的超链接，则在有向图中有一个从节点 A 指向节点 B 的有向边。</p>
<p>网页重要性的计算公式为：<br>$$S(V_i)=(1-d)+d\times \sum_{j\in In(V_i)}\frac{1}{|Out(V_j)|}S(V_j)$$<br>其中 d 是阻尼系数，一般设置为 0.85。$In(V_i)$ 是存在指向网页 i 的链接的网页集合。$Out(V_j)$ 是网页 j 中的链接指向的网页的集合。在初始时，每个网页的重要性 $S(V_i)$ 可以设为 1，利用以上公式经过多次迭代便可以得到最终结果。</p>
<p>该公式表示一个网页的重要性由指向该网页的超链接所在的网页的重要性所决定。</p>
<hr>

<h3 id="TextRank-自动摘要"><a href="#TextRank-自动摘要" class="headerlink" title="TextRank 自动摘要"></a>TextRank 自动摘要</h3><p><strong>TextRank 自动摘要</strong></p>
<p>在 TextRank 所构建的图中，节点就是句子，权重 w 就是两个句子 $S_i$ 和 $S_j$ 的相似程度，两个句子的相似度用以下公式来计算：
 <br>$$Similarity(S_i,S_j)=\frac{(w_k|w_k\in S_i\quad\cap\quad w_k\in S_j)}{\log(|S_i|)+\log(|S_j|)}$$<br>TextRank 公式在 PageRank 公式的基础上，为图中的边引入了权值的概念：
<br>$$WS(V_i)=(1-d)+d\times \sum_{j\in In(V_i)}\frac{w_{ji}}{\sum_{V_k\in Out(V_j)}w_{jk}}WS(V_j)$$<br>其中 $w_{ij}$ 是从节点 $V_i$ 到 $V_j$  的边的权值。<br>算法流程为：将文本进行分词和词性标注处理，去除停用词或词性筛选等之后，设定窗口长度为 K，即最多只能出现 K 个词，进行窗口滑动，在窗口中共同出现的词之间即可建立起无向边。初始化边的权重， 根据公式进行迭代权重，直到收敛。则词的重要性最大的几个词就为提取到的关键词。</p>

<pre><code class="hljs python"><span class="hljs-keyword">from</span> textrank4zh <span class="hljs-keyword">import</span> TextRank4Keyword, TextRank4Sentence
<span class="hljs-comment"># 输出关键词，设置文本小写，窗口为2</span>
tr4w = TextRank4Keyword()
tr4w.analyze(text=text, lower=<span class="hljs-literal">True</span>, window=<span class="hljs-number">2</span>)
print(<span class="hljs-string">&#x27;关键词：&#x27;</span>)
<span class="hljs-keyword">for</span> item <span class="hljs-keyword">in</span> tr4w.get_keywords(<span class="hljs-number">20</span>, word_min_len=<span class="hljs-number">1</span>):
    print(item.word, item.weight)
<span class="hljs-comment"># 输出重要的句子</span>
tr4s = TextRank4Sentence()
tr4s.analyze(text=text, lower=<span class="hljs-literal">True</span>, source = <span class="hljs-string">&#x27;all_filters&#x27;</span>)
print(<span class="hljs-string">&#x27;摘要：&#x27;</span>)
<span class="hljs-comment"># 重要性较高的三个句子</span>
<span class="hljs-keyword">for</span> item <span class="hljs-keyword">in</span> tr4s.get_key_sentences(num=<span class="hljs-number">3</span>):
    <span class="hljs-comment"># index是语句在文本中位置，weight表示权重</span>
    print(item.index, item.weight, item.sentence)
</code></pre>
<h3 id="4-词云生成工具WordCloud"><a href="#4-词云生成工具WordCloud" class="headerlink" title="4.词云生成工具WordCloud"></a>4.词云生成工具WordCloud</h3><pre><code class="hljs python"><span class="hljs-comment"># 安装</span>
pip install wordcloud

<span class="hljs-comment"># 生成词云</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">create_word_cloud</span>(<span class="hljs-params">f</span>):</span>
	f = remove_stop_words(f) <span class="hljs-comment">#出去stop word</span>
	cut_text = word_tokenize(f) <span class="hljs-comment"># nltk分词</span>
	cut_text = <span class="hljs-string">&quot; &quot;</span>.join(cut_text)  <span class="hljs-comment"># 合并</span>
    wc = WordCloud(
        max_words=<span class="hljs-number">100</span>, <span class="hljs-comment"># 限制词数</span>
        width=<span class="hljs-number">1200</span>,
        height=<span class="hljs-number">800</span>,
        background_color=<span class="hljs-string">&#x27;white&#x27;</span>,  <span class="hljs-comment"># 背景颜色</span>
        font_path=<span class="hljs-string">&quot;E:\Windows\Fonts\simhei.ttf&quot;</span> <span class="hljs-comment"># 设置字体</span>
    )
	wordcloud = wc.generate(cut_text)
	wordcloud.to_file(<span class="hljs-string">&quot;wordcloud.jpg&quot;</span>)
</code></pre>
<p>参考资料：</p>
<ul>
<li><a target="_blank" rel="noopener" href="https://blog.csdn.net/Eastmount/article/details/92440722">[Python知识图谱] 二.哈工大pyltp词性标注、命名实体识别、依存句法分析和语义角色标注</a></li>
<li><a target="_blank" rel="noopener" href="https://www.jianshu.com/p/883c2171cdb5">简明 jieba 中文分词教程</a></li>
</ul>

            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                  <div class="post-meta mr-3">
                    <i class="iconfont icon-category"></i>
                    
                      <a class="hover-with-bg" href="/walker_sue/categories/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/">机器学习</a>
                    
                  </div>
                
                
                  <div class="post-meta">
                    <i class="iconfont icon-tags"></i>
                    
                      <a class="hover-with-bg" href="/walker_sue/tags/BI/">BI</a>
                    
                      <a class="hover-with-bg" href="/walker_sue/tags/%E6%9C%BA%E5%99%A8%E5%AD%A6%E4%B9%A0/">机器学习</a>
                    
                      <a class="hover-with-bg" href="/walker_sue/tags/NLP/">NLP</a>
                    
                  </div>
                
              </div>
              
                <p class="note note-warning">本博客所有文章除特别声明外，均采用 <a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！</p>
              
              
                <div class="post-prevnext row">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/walker_sue/2021/02/14/BI-week4-airbnb/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">AIRBNB 个性化推荐与信用卡欺诈预测</span>
                        <span class="visible-mobile">Vorheriger</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/walker_sue/2021/01/25/week3-weekday/">
                        <span class="hidden-mobile">时间序列分析（三） 周期因子</span>
                        <span class="visible-mobile">Nächster</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;TOC</p>
  <div id="tocbot"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    
  </main>

  
    <a id="scroll-top-button" href="#" role="button">
      <i class="iconfont icon-arrowup" aria-hidden="true"></i>
    </a>
  

  
    <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">Suchen</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">Stichwort</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
  

  

  <footer class="text-center mt-5 py-3">
  <div class="footer-content">
     <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a> 
  </div>
  

  

  
</footer>

<!-- SCRIPTS -->
<script  src="https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js" ></script>
<script  src="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/js/bootstrap.min.js" ></script>
<script  src="/walker_sue/js/debouncer.js" ></script>
<script  src="/walker_sue/js/main.js" ></script>

<!-- Plugins -->


  
    <script  src="/walker_sue/js/lazyload.js" ></script>
  



  



  <script defer src="https://cdn.staticfile.org/clipboard.js/2.0.6/clipboard.min.js" ></script>
  <script  src="/walker_sue/js/clipboard-use.js" ></script>







  <script  src="https://cdn.staticfile.org/tocbot/4.11.1/tocbot.min.js" ></script>
  <script>
    $(document).ready(function () {
      var boardCtn = $('#board-ctn');
      var boardTop = boardCtn.offset().top;

      tocbot.init({
        tocSelector: '#tocbot',
        contentSelector: '#post-body',
        headingSelector: 'h1,h2,h3,h4,h5,h6',
        linkClass: 'tocbot-link',
        activeLinkClass: 'tocbot-active-link',
        listClass: 'tocbot-list',
        isCollapsedClass: 'tocbot-is-collapsed',
        collapsibleClass: 'tocbot-is-collapsible',
        collapseDepth: 0,
        scrollSmooth: true,
        headingsOffset: -boardTop
      });
      if ($('.toc-list-item').length > 0) {
        $('#toc').css('visibility', 'visible');
      }
    });
  </script>



  <script  src="https://cdn.staticfile.org/typed.js/2.0.11/typed.min.js" ></script>
  <script>
    function typing(id, title){
        var typed = new Typed('#' + id, {
            strings: [
              '  ',
              title + "&nbsp;",
            ],
            cursorChar: "_",
            typeSpeed: 70,
            loop: false,
        });
        typed.stop();
        $(document).ready(function () {
            $(".typed-cursor").addClass("h2");
            typed.start();
        });
    }
    
        typing("subtitle", "新闻自动化处理（一）")
    
  </script>


  <script  src="https://cdn.staticfile.org/anchor-js/4.2.2/anchor.min.js" ></script>
  <script>
    anchors.options = {
      placement: "right",
      visible: "hover",
      
    };
    var el = "h1,h2,h3,h4,h5,h6".split(",");
    var res = [];
    for (item of el) {
      res.push(".markdown-body > " + item)
    }
    anchors.add(res.join(", "))
  </script>



  <script  src="/walker_sue/js/local-search.js" ></script>
  <script>
    var path = "/walker_sue/local-search.xml";
    var inputArea = document.querySelector("#local-search-input");
    inputArea.onclick = function () {
      searchFunc(path, 'local-search-input', 'local-search-result');
      this.onclick = null
    }
  </script>



  <script  src="https://cdn.staticfile.org/fancybox/3.5.7/jquery.fancybox.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.staticfile.org/fancybox/3.5.7/jquery.fancybox.min.css" />

  <script>
    $('#post img:not(.no-zoom img, img[no-zoom]), img[zoom]').each(
      function () {
        var element = document.createElement('a');
        $(element).attr('data-fancybox', 'images');
        $(element).attr('href', $(this).attr('src'));
        $(this).wrap(element);
      }
    );
  </script>





  

  
    <!-- MathJax -->
    <script>
      MathJax = {
        tex: {
          inlineMath: [['$', '$'], ['\\(', '\\)']]
        },
        options: {
          renderActions: {
            findScript: [10, doc => {
              document.querySelectorAll('script[type^="math/tex"]').forEach(node => {
                const display = !!node.type.match(/; *mode=display/);
                const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display);
                const text = document.createTextNode('');
                node.parentNode.replaceChild(text, node);
                math.start = { node: text, delim: '', n: 0 };
                math.end = { node: text, delim: '', n: 0 };
                doc.math.push(math);
              });
            }, '', false],
            insertedScript: [200, () => {
              document.querySelectorAll('mjx-container').forEach(node => {
                let target = node.parentNode;
                if (target.nodeName.toLowerCase() === 'li') {
                  target.parentNode.classList.add('has-jax');
                }
              });
            }, '', false]
          }
        }
      };
    </script>

    <script async src="https://cdn.staticfile.org/mathjax/3.0.5/es5/tex-svg.js" ></script>

  











</body>
</html>
